#ifndef __ALIGNEROUTPUT_H__
#define __ALIGNEROUTPUT_H__
#include "../CompressAlign/cpp/compress_gpu.h"
#include "../cpp/cuda_header.h"
#include "findMisMatch_gpu.h"
#include "../cpp/result.h"
#include <mian_util.h>
#include "util.h"

uint32 getRefPos(uint3* SA_result, uint32 numSA, uint32* saIndex,uint32 numAlign, uint32* queryId,uint32* offset, uint32* pos);
void getRefPosResult(uint3* cpuSA, uint32 numSA, uint32 nresult, uint32 textLength, uint32** queryId0,uint32** offset0, uint32** pos0, char* ref_name);
void compressQueryId(uint32* queryId, uint32 dataSize,uint32 numQuery, uint32* outId, uint32* outLen, uint32* outDataSize);
void decompressQueryId(uint32* in, uint32* in_len, uint32 dataSize, uint32* out, uint32* outSize);
void outputIdPos(uint32* c_queryId, uint32* c_queryId_len, uint32 compressedSize, uint32* offset,uint32 numSA,
                uint32* pos, uint32 nresult, FILE* resultFile, uint32* totalOutputSize);

void fullSizeOutput(Read* readBuf, Buffer* buf, uint32 nresult, uint32 numSA, FILE *fout, char* ref);
void compressOutputLimited(Read* readBuf, Buffer* buf, uint32 nresult, uint32 numSA, FILE *fout, char* ref);

char getComplement(char base);
void reverse_complement(char* outRead, const char* inRead, const uint32 readLength);
#endif
